{% extends "safeinside/base.html" %}
{% block title%}События объекта {{ obj.targetid }} по типам{% endblock %}

{% block content %}
<h1>Количество событий объекта {{ obj.targetid }} по их типам</h1>
{% if not standalone %}
<a href="/object_count_events_by_type/normal_standalone/{{ obj.targetid }}">Версия для операторов</a>
{% endif %}

<form class="form-horizontal" role="form" method="post" action="/object_count_events_by_type/normal_standalone/{{ obj.targetid }}">
{% csrf_token %}
 <div class="form-group">
  <label for="rangeFrom" class="col-md-2 control-label">С</label>
  <div class="col-md-2">
   <input class="form-control" type="text" id="rangeFrom" name="rangeFrom" data-field="datetime" readonly>
  </div>
 </div>
 <div class="form-group">
  <label for="rangeTo" class="col-md-2 control-label">по</label>
  <div class="col-md-2">
   <input class="form-control" type="text" id="rangeTo" name="rangeTo" data-field="datetime" readonly>
  </div>
 </div>
 <div id="dtBox"></div>
 <div class="form_group">
  <button type="submit" class="btn btn-primary">Получить события по типам</button>
 </div>
</form>

<script type="text/javascript">
 $(document).ready(function()
{
 $("#dtBox").DateTimePicker();
});
</script>


{% include "safeinside/event_types.html" %}

<div class="row">
 <div class="col-md-4">
  Идентификатор объекта
 </div>
 <div class="col-md-4">
  {{ obj.targetid }}
 </div>
</div>
<div class="row">
 <div class="col-md-4">
  Идентификатор CID
 </div>
 <div class="col-md-4">
  {{ obj.msid }}
 </div>
</div>

<table class="table table-stripped table-bordered" data-sort-name="etype" data-toggle="table">
 <thead>
  <tr>
   <th data-field="etype" data-sortable="true">Тип события</th>
   <th data-field="ecount" data-sortable="true">Количество</th>
  </tr>
 </thead>
{% for etype,ecount in obj.counts.items %}
 <tr>
  <td>{{ etype }} </td>
  <td>{{ ecount }}</td>
 </tr>
{% endfor %}
</table>
<hr>

{% endblock %}
